/**************************************************************************************** Import */
import _ from 'lodash';
import React, {Component} from 'react';
import { TextInput, View, Dimensions } from 'react-native';
import { Icon,  List, Button, InputItem, Tabs, TextareaItem, DatePicker, Accordion } from 'antd-mobile-rn';
import { CAround, CBetween, CCenter, CColumn, CFloat, CHand, CItemX, CItemY, CLine, CLoad, CRow, CWrap, CBone, CIcon, CImage, CSvg, CText, CFull, CScroll, CFooter, CHeader, CPage, CButton, CLabel, PTabbar, PHeader } from '../../../../library/comp';
import { Dialog, Http, PageBase } from '../../../../library/func';
import Design from '../../../../design';
import Config from '../../../../config';

/**************************************************************************************** Pageload */

/**************************************************************************************** Cacheload */

/**************************************************************************************** Preload */

/**************************************************************************************** Get */

/**************************************************************************************** Post */

/**************************************************************************************** Page */
export default class UserSettingCarAdd extends PageBase {
    constructor(props) {
        super(props);
        this.state = {
            carcode:"",
        };
    }


    /************************************************************************************ Event */
    submitInfo(){

        if(this.state.carcode == ""){
            Dialog.text("请填写车牌号", 1);
            return;
        }

        // HttpTemp.post({

        //     url:"/CPage/mycar/logic/add.php",
        //     data:{
        //         set_number:this.state.carcode
        //     },
        //     success:(res) => {
        //         Dialog.text("已成功添加", 1);
        //     },
        //     error: {
        //         code: (res)=> {
        //             Dialog.text(res.msg, 1);
        //         }
        //     }

        // })
    }

    /************************************************************************************ Render */
    render(){
        return(
            <CPage>

                <CScroll bg='rgba(248, 248, 248, 1)' mt='96'>

                    <CColumn>

                        {/* 车辆信息标题 */}
                        <CItemX w="750" mx="30" h="80" y="center"> 
                            <CText color="#AEAEAE" size="26">车辆信息</CText>
                        </CItemX>
                        
                        <CItemY  w="750" bg="white" ra='8'>

                            {/* 车牌号码信息 */}
                            <CItemX w="750" px="30" style={{ borderBottomWidth:1, borderBottomColor:"#eee" }}  h="100" y="center"> 
                                <CBetween>
                                    <CText color="#434343" size="30">车牌号码</CText>
                                    <TextInput
                                        onChangeText={(val)=>{
                                            this.setState({
                                                carcode:val,
                                            })
                                        }}

                                        style={{  minWidth:150, textAlign:"right" }}
                                        defaultValue={ this.state.carcode }  
                                        clearTextOnFocus={true}
                                        placeholder="请输入车牌号码"
                                        placeholderTextColor="#c9c9c9"
                                        underlineColorAndroid="transparent"
                                    />
                                </CBetween>
                            </CItemX>

                        </CItemY>

                        {/* 保存按钮 */}
                        <CColumn py='10' mt='60' px='30'>
                            <CButton {...Design.global.commonButton} onPress={this.submitInfo.bind(this)}>添加</CButton>
                        </CColumn>

                    </CColumn>
                    
                </CScroll>

                {/* header */}
				<PHeader nav={this.nav}>添加车辆</PHeader>

            </CPage>
        )
    }
}

